<%@page import="Entity.Roles"%>
<%@page import="Helpers.Sesion"%>
<%@page import="Entity.Participante"%>
<%@page import="Helpers.Helper"%>
<%@page import="Helpers.Participantes"%>
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="ISO-8859-1">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
        
        <link href="css/myStyles/style.css" rel="stylesheet" type="text/css" />
        <script src="js/vendor/modernizr-2.6.2.min.js"></script>
        
        <script type="text/javascript" src="css/myStyles/nuj5imv.js"></script>
        <style type="text/css">.tk-cooper-black-std{font-family:"cooper-black-std-1","cooper-black-std-2",sans-serif;}</style>
        <link href="js/myLibs/nuj5imv-e.css" rel="stylesheet" />
        
        <style type="text/css">

            a:link, a:visited {
                    text-decoration: none;
                    color: #fff;
                    border: none;
                    }	

            #stamp {	
                    display: block;
                    margin: 20px 0;
                    border: none;
                    -webkit-transition: opacity .2s ease;
                    -moz-transition: opacity .2s ease;
                    -o-transition: opacity .2s ease;
                    transition: opacity .2s ease;
                    }
            #stamp:hover {	
                    opacity: .7;
                    }

            /* button styles */

            .btn {		
                font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
                    font-weight: bold;
                    font-size: 120%;
                    display: inline-block;
                    -webkit-border-radius: 8px;
                    -moz-border-radius: 8px;
                    border-radius: 8px;
                    -webkit-box-shadow:
                            0 8px 0 #1a74a1,
                            0 15px 20px rgba(0,0,0,.35);
                    -moz-box-shadow:
                            0 8px 0 #1a74a1,
                            0 15px 20px rgba(0,0,0,.35);
                    box-shadow:
                            0 8px 0 #1a74a1,
                            0 15px 20px rgba(0,0,0,.35);
                    -webkit-transition: -webkit-box-shadow .2s ease-in-out;
                    -moz-transition: -moz-box-shadow .2s ease-in-out;
                    -o-transition: -o-box-shadow .2s ease-in-out;
                    transition: box-shadow .2s ease-in-out;
                    }
            .btn span {	
                    display: inline-block;
                    padding: 10px  20px;
                    font-family: "cooper-black-std-1", "cooper-black-std-2", Helvetica, Arial, sans-serif;
                    line-height: 1;
                    text-shadow: 0 -1px 1px rgba(19,65,88,.8);
                    background: #3194c6;
                    background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#3194c6), to(#5bacd6));
                    background: -moz-linear-gradient(#3194c6, #5bacd6);
                    -webkit-border-radius: 8px;
                    -moz-border-radius: 8px;
                    border-radius: 8px;
                    -webkit-box-shadow: inset 0 -1px 1px rgba(255,255,255,.15);
                    -moz-box-shadow: inset 0 -1px 1px rgba(255,255,255,.15);
                    box-shadow: inset 0 -1px 1px rgba(255,255,255,.15);
                    -webkit-transition: -webkit-transform .2s ease-in-out;
                    -moz-transition: -moz-transform .2s ease-in-out;
                    -o-transition: -o-transform .2s ease-in-out;
                    transition: transform .2s ease-in-out;
                    }
            .btn:active {	
                    -webkit-box-shadow: 
                            0 8px 0 #1a74a1,
                            0 12px 10px rgba(0,0,0,.3);
                    -moz-box-shadow: 
                            0 8px 0 #1a74a1,
                            0 12px 10px rgba(0,0,0,.3);
                    box-shadow: 
                            0 8px 0 #1a74a1,
                            0 12px 10px rgba(0,0,0,.3);
                    }
            .btn:active span {	
                    -webkit-transform: translate(0, 4px);
                    -moz-transform: translate(0, 4px);
                    -o-transform: translate(0, 4px);
                    transform: translate(0, 4px);
                    }
            </style>
    </head>
    <body>
        <!--[if lt IE 7]>
            <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
        <![endif]-->

        <!-- Add your site or application content here -->
        
        <div class="tail-top-left" ></div>
        <div class="tail-top-left1"></div>
        <div class="tail-top-right"></div>
        <div class="tail-top">
                <div id="main">
                        <!-- header -->
                        <div id="header">
                                <div class="extra"><img src="img/header-img.png" class="png" alt="" /></div>
                                <div class="row-1">
                                        <div class="fleft"><a href="index.jsp"><img src="img/logo.jpg" alt="" /></a></div>
                                        <div class="fright">
                                                <ul>
                                                        <li><a href="index.jsp"><img src="img/icon1.gif" alt="" /></a></li>
                                                        <li class="last"><a href="Contactanos.jsp"><img src="img/icon2.gif" alt="" /></a></li>
                                                </ul>
                                        </div>
                                </div>
                                <div class="row-2">
                                        <div class="nav-box">
                                                <div class="left png">
                                                        <div class="right png">
                                                                <div class="tail png">
                                                                        <ul>
                                                                                <li><a href="index.jsp">Inicio</a></li>
                                                                                
                                                                                <%
                                                                                    Sesion oSesion = new Sesion();
                                                                                    boolean login= false;
                                                                                    if(session.getAttribute("oSesion") != null){
                                                                                        oSesion = (Sesion)session.getAttribute("oSesion");
                                                                                        Roles rol = new Roles();
                                                                                        login = true;
                                                                                        if(oSesion.getRol().equals(rol.Administrador)){
                                                                                            out.println("<li><a href=\"Administration.jsp\">Admin</a></li>");
                                                                                            out.println("<li><a href=\"Sorteo.jsp\">Sortear</a></li>");
                                                                                        }else
                                                                                            response.sendRedirect("Participantes.jsp");
                                                                                    }else
                                                                                        out.println("<li><a href=\"Login.jsp\">Inicia Sesion</a></li>");
                                                                                    
                                                                                %>
                                                                                <li class="last"><a href="Participantes.jsp">Participantes</a></li>
                                                                        </ul>
                                                                </div>
                                                        </div>
                                                </div>
                                        </div>
                                </div>
                        </div>
                        <!-- content -->
                        <div id="content">
                                <div class="wrapper">
                                        <div class="box">
                                                <div class="top png"></div>
                                                <div class="tail png">
                                                        <div class="indent">
                                                            <center>
                                                                <form action="Administracion" method="POST" id="frm">
                                                                    
                                                                    <%
                                                                    if(session.getAttribute("oMensaje") != null){
                                                                        out.println(String.format("<h4>%s</h4>",session.getAttribute("oMensaje")));
                                                                        session.removeAttribute("oMensaje");                                                                        
                                                                    }
                                                                    %>
                                                                
                                                                    <h2>Lista de participantes</h2>

                                                                    <%
                                                                        Participantes oParticipantes;
                                                                        Helper oHelp = new Helper();

                                                                        oParticipantes = oHelp.load();
                                                                        //Verificamos que existan participantes
                                                                        if(oParticipantes != null && oParticipantes.getParticipantes() != null && oParticipantes.getParticipantes().size() > 0){
                                                                            out.println("<ul class=\"list3\">");
                                                                            for(Participante participante : oParticipantes.getParticipantes()){
                                                                                out.println(String.format("<li><input type=\"checkbox\" name=\"chkParticipantes\" value=\"%s\" />   %s: %s</li>",participante.getCedula(), participante.getCedula(),participante.getCorreo()));
                                                                            }
                                                                            out.println("</ul>");

                                                                            out.println("<a href=\"#\" class=\"btn\" id=\"btnEliminar\" title=\"Eliminar participantes\" onclick=\"return false;\"><span>Eliminar</span></a>");
                                                                            out.println("<a href=\"#\" class=\"btn\" id=\"btnReset\" title=\"Resetear password\" onclick=\"return false;\"><span>Reset Pass</span></a>");
                                                                            out.println("<a href=\"#\" class=\"btn\" id=\"btnInfo\" title=\"Enviar informacion\" onclick=\"return false;\"><span>Enviar info</span></a>");
                                                                        }else{
                                                                            out.println("<h4>No se encuentran participantes</h4>");
                                                                        }
                                                                    %>
                                                                    <input type="hidden" name="btnAccion" id="btnAccion" />
                                                                </form>
                                                            </center>

                                                        </div>
                                                </div>
                                                <div class="bot png"></div>
                                        </div>
                                        <div class="right-side">
                                                <%
                                                    if(login){
                                                        out.println("<ul class=\"list1\">");
                                                        out.println("<li><a href=\"Login?t="+oSesion.getCedula()+"  \" title=\"Cerrar Sesion\">"+oSesion.getUsuario()+"</a>");
                                                        if(oSesion.getAsignado() != null)
                                                            out.println("<p>Debes regalar a: "+oSesion.getAsignado()+"</p>");
                                                        else
                                                            out.println("<p>No tienes participante asignado</p>");
                                                        
                                                        out.println("</li></ul>");
                                                    }
                                                %>
                                                <h2>Condiciones:</h2>
                                                <ul class="list1">
                                                        <li><a href="#">Monto</a><p>El monto para el intercambio sera de 5000 colones!, ni mas ni menos!.</p></li>
                                                        <li><a href="#">1 Diciembre 2012</a><p>El sorteo se realizara de forma automatica, en la fecha indicada.</p></li>
                                                        <li><a href="#">22 Diciembre 2012</a><p>Los participantes deberan de realizar el intercambio en la fecha indicada.</p></li>                                                        
                                                </ul>
                                        </div><div class="inner_copy"></div>
                                </div>
                        </div>
                        <!-- footer -->
                        <div id="footer">
                                <div class="indent">
                                        <div class="fleft">robert.baron@s-com.com</div>
                                        <div class="fright">Intercambio S-COM</div>
                                </div>
                        </div>
                </div>
        </div>
        <hidden id="regHid"></hidden>
        
        
        
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.8.2.min.js"><\/script>')</script>
        <script src="js/plugins.js"></script>
        <script src="js/main.js"></script>
        <script src="js/myLibs/christmasJS.js"></script>

        <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
        <script>
            var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
            (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
            g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
            s.parentNode.insertBefore(g,s)}(document,'script'));
        </script>
    </body>
</html>
